#include <stdio.h>

//https://www.nowcoder.com/practice/22e87f8a8d764a6582710f38d1b40c6e?tpId=290&tags=&title=&difficulty=0&judgeStatus=0&rp=0&sourceUrl=%2Fexam%2Foj%2Fta%3FtpId%3D290

int main()
{
    int i, arr[100], n, cnt1 = 0, cnt2 = 0;
    scanf("%d", &n);
    for (i = 0; i < n; i++) {
        scanf("%d", &arr[i]);
    }
    for(i=0;i<n-1;i++) {
        if (arr[i] - arr[i + 1] >= 0) {  //降序计数
            cnt1++;
        } else if (arr[i] - arr[i + 1] <= 0) {  //升序计数
            cnt2++;
        }
    }
    if (cnt1 == n - 1 || cnt2 == n - 1) {
        printf("sorted");
    } else {
        printf("unsorted");
    }
}
